from DrissionPage import WebPage
import time

# 创建页面对象
page = WebPage()

# 访问网址
page.get('https://www.12365auto.com/zlts/')

page.ele('#wd').input('1227757')

page.run_js('document.querySelector("[id=gjz_sub]").click()')

# 等待页面加载
time.sleep(5)

# 获取表格元素
table = page.ele('.tslb_b')

if table:
    # 获取所有行元素
    rows = table.eles('tag:tr')
    print(f"找到 {len(rows)} 行数据")
    # 遍历行并打印第一列数据
    for row in rows:
        cells = row.eles('tag:td')
        if cells:
            for cell in cells:
                print(cell.text)
else:
    print("未找到表格元素")